﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace OperationLibrary
{
    public class OperationFactory
    {
        public static Operation Create(string operation)
        {
            switch (operation)
            { 
                case "+":
                    return new OperationAdd();
                case "-":
                    return new OperationSub();
                case "*":
                    return new OperationMul();
                case "/":
                    return new OperationDiv();
                default:
                    throw new Exception("还未实现该功能");
            }
        }
    }
}
